package grpcserver

import (
	"context"

	aiv1 "github.com/devops-smartbot/devops-smartbot/proto/gen/go/ai/v1"
	"github.com/devops-smartbot/devops-smartbot/services/ai-gateway/internal/service"
)

// Server implements the gRPC AIGateway.
type Server struct {
	aiv1.UnimplementedAIGatewayServer
	service service.Service
}

// New constructs the server.
func New(service service.Service) *Server {
	return &Server{service: service}
}

// Analyze proxies request to service layer.
func (s *Server) Analyze(ctx context.Context, req *aiv1.AnalyzeRequest) (*aiv1.AnalyzeResponse, error) {
	return s.service.Analyze(ctx, req)
}

var _ aiv1.AIGatewayServer = (*Server)(nil)
